package org.protege.owl.examples.tab;

public class Predicate
{
	private String name;
	private int argumentsNmb;
	private boolean positive;
	
	public Predicate(String s, int args)
	{
		name = new String(s);
		argumentsNmb = args;
		positive = true;
	}
	
	public Predicate(String s, int args, boolean isPositive)
	{
		name = new String(s);
		argumentsNmb = args;
		positive = isPositive;
	}
	
	public boolean positive()
	{
		return positive;
	}
	
	public String name()
	{
		return new String(name);
	}
	
	public int argumentsNmb()
	{
		return argumentsNmb;
	}
	
	@Override public boolean equals(Object o)
	{
		if (!(o instanceof Predicate)) return false;
		Predicate pre2 = (Predicate) o;
		if (name.equals(pre2.name()) && (pre2.argumentsNmb() == argumentsNmb || pre2.argumentsNmb() == 0))
			return true;
		else
			return false;		
	}
	
	@Override public int hashCode()
	{
		return name.hashCode();
	}
}